﻿using DAL;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLL
{
    public class Content_BLL
    {
        Content_DAL content_DAL = new Content_DAL();

        public IEnumerable<Content> SearchContentList()
        {
            return content_DAL.SearchContentList();
        }

        public IEnumerable<Content> SearchContentList(Int64 categoryId)
        {
            return content_DAL.SearchContentList(categoryId);
        }

        public bool Add(Content content)
        {
            return content_DAL.Add(content);
        }

        public Int64 Add2(Content content)
        {
            return content_DAL.Add2(content);
        }

        public Content GetById(Int64 id)
        {
            return content_DAL.GetById(id);
        }

        public Content GetByCreateTime(DateTime createTime)
        {
            return content_DAL.GetByCreateTime(createTime);
        }

        public bool Update(string content, Int64 contentId,string title)
        {
            return content_DAL.Update(content, contentId, title);
        }

        public bool Update(string content, Int64 contentId, string title,string cover)
        {
            return content_DAL.Update(content, contentId, title,cover);
        }

        public bool Delete(Int64 contentId)
        {
            return content_DAL.Delete(contentId);
        }

        /// <summary>
        /// 根据时间获取最新的内容
        /// </summary>
        public Content GetContent(Int64 categoryId)
        {
            return content_DAL.GetContent(categoryId);
        }
    }
}
